package com.app.util.common;

import org.apache.cxf.endpoint.Client;
import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;

public class CxfUtil {
	
	public static Object[] getSession(String webServiceUrl,String methodName,Object... args){
		
		Object[]  result =null;
        JaxWsDynamicClientFactory  factory =JaxWsDynamicClientFactory.newInstance();
        Client client =factory.createClient(webServiceUrl+"?wsdl");
        //Client client =factory.createClient(webServiceUrl);
    	try {
    		result =client.invoke(methodName,args);
  		}catch (Exception e) {
  		  // TODO Auto-generated catch block
  			e.printStackTrace();
  		}
		return result;
	}
}
